{include file="public/header"}

<div class="index_html  add_jilu set pc_set">
    {include file="public/second_header"}


    <div class="list_box set_box">
        {include file="public/main_bread"}
        <form action="" class="horizontal" method="post" role="form" >
            <div class="center">
                <div class="left">
                    <div class="img_box" id="userInfo_display">
                    {if condition="$userInfo['avatar']"}

                        <img src="{$userInfo['avatar']}" alt="" width="200px" height="200px">
                        <input type='hidden' value="{$userInfo['avatar']}" nae="avatar">

                    {else/}
                        <img src="__STATIC__/index/imgs/doctor.jpg" alt="" width="200px" height="200px">
                    {/if}
                    </div>

                    <div class="up_box" id="userInfo_upload">
                        <a>
                            <span>修改头像</span>
                            <input type="file">
                        </a>
                    </div>
                </div>
                <div class="right">
                    <ul>
                        <li>
                            <span>用户名：</span>
                            <em>{$userInfo['admin_name']}</em>
                        </li>
                        <li>
                            <span>姓名：</span>
                            <em>{$userInfo['name']}</em>
                        </li>
                        <li>
                            <span>所属部门：</span>
                            <em>{$userInfo['department']}</em>
                        </li>
                        <li>
                            <span>旧密码：</span>
                            <div class="input_box">
                                <input type="password" name="old_password">
                            </div>
                        </li>
                        <li>
                            <span>新密码：</span>
                            <div class="input_box">
                                <input type="password" name="new_password">
                            </div>
                        </li>
                        <li>
                            <span>确认密码：</span>
                            <div class="input_box">
                                <input type="password" name="confirm_password">
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="save_or_no">
                <a  class="cirtain">
                    <input type="hidden" name="userId" value="{$userInfo['admin_id']}">
                    <input type="button" class="ajax-post" value="提交">
                </a>
            </div>
            </form>
        </div>

    </div>
</div>
{include file="public/footer"}

<script src="__STATIC__/common/webuploader/webuploader.min.js"></script>
<script>
    //图片上传
    var uploader = WebUploader.create({
        auto: true,
        swf:'__ASSETS__/lib/webuploader/Uploader.swf',
        server:'{:url("common/upload/uploadFile")}',
        pick:'#userInfo_upload',
        fileVal:'pic',

        duplicate :true

    })

    uploader.on('uploadSuccess', function(file, response){
        //console.log(response);
        if (response.error == 0) {
            var html = '';
            html += '<img src="'+response.url+'"  width="200px" height="200px" />';
            html += '<input type="hidden" class="body_album" name="avatar" value="'+response.url+'" />';
            $('#userInfo_display').replaceWith(html);
        }
    });



</script>
